package com.ruoyi.wjq.domain;

import com.ruoyi.fk.domain.Question;
import com.ruoyi.ssh.domain.Course;
import com.ruoyi.ssh.domain.Subject;
import com.ruoyi.youyou.domain.SysYouYouUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 题目收藏对象 favorite_question
 * 
 * @author wjq
 * @date 2025-08-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FavoriteQuestion extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 收藏ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 题目ID */
    @Excel(name = "题目ID")
    private Long questionId;

    /** 0是已删除，1是保留 */
    private Long del;

    private SysYouYouUser sysYouYouUser;
    private Question question;
    private Course course;
    private Subject subject;

    // 新增：仅用于查询的字段（不映射数据库，纯粹条件）
    private String nickName; // 仅用于查询的用户昵称
    private String title;    // 仅用于查询的题目标题






    public SysYouYouUser getSysYouYouUser() {
        return sysYouYouUser;
    }

    public void setSysYouYouUser(SysYouYouUser sysYouYouUser) {
        this.sysYouYouUser = sysYouYouUser;
    }

    public Question getQuestion() {
        return question;
    }

    public void setQuestion(Question question) {
        this.question = question;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setQuestionId(Long questionId) 
    {
        this.questionId = questionId;
    }

    public Long getQuestionId() 
    {
        return questionId;
    }

    public void setDel(Long del) 
    {
        this.del = del;
    }

    public Long getDel() 
    {
        return del;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("questionId", getQuestionId())
            .append("createTime", getCreateTime())
            .append("del", getDel())
            .append("sysYouYouUser", getSysYouYouUser())   // 新增关联对象打印
            .append("question", getQuestion()) // 新增关联对象打印
            .append("nickName", getNickName()) // 打印查询用的昵称
            .append("title", getTitle())       // 打印查询用的标题
            .toString();
    }
}
